#include "spl.includes.h"
#include "splib.h"

using namespace SPLib;
using namespace SPLib::Windows;

#define SPL_HIDDENWND_CLASS _T("SPLib.HiddenWindow")

BOOL HiddenWnd::create(HINSTANCE hInstance)
{
  // window class
  WNDCLASSEX wndClass;

  // initialize window class
  memset(&wndClass, 0, sizeof(wndClass));

  // set window class values
  wndClass.cbSize = sizeof(wndClass);
  wndClass.lpszClassName = SPL_HIDDENWND_CLASS;
  wndClass.lpfnWndProc = defWndProc;
  wndClass.hInstance = hInstance;

  // register window class, abort on error
  if (!RegisterClassEx(&wndClass)) return FALSE;

  // create window
  return create(wndClass.lpszClassName, wndClass.hInstance);
}

void HiddenWnd::wndProc(Event::WndProcEvent& iEvent)
{
  switch (iEvent.msg)
  {
  case WM_CREATE:
    initWindow();
    iEvent.handled = TRUE;
    onCreate(Event::WndCreateEvent(iEvent.lParam, &iEvent.lResult));
    --iEvent.lResult;
    break;
  default:
    WndBase::wndProc(iEvent);
  }
}

VOID HiddenWnd::onCreate(Event::WndCreateEvent& iEvent)
{
}
